import request from "@/utils/request"

//定义公共的API
const BASE_URL = "/system/itrSights";

export default {
   getSights(){
    return request({
        url: `${BASE_URL}//findAll`,
        method: 'get',
       
    })
   },

   //用户分页查询
   getSightsPageInfo(page, limit, searchObj) {
    return request({
        url: `${BASE_URL}/${page}/${limit}`,
        method: 'get',
        params: searchObj
    })
    },
    //状态修改
    updateStatus(id,isActivated){
        return request({
            url:`${BASE_URL}/updateStatus/${id}/${isActivated}`,
            method: 'get'
          }) 
     },
     // 添加景点
    saveSights(sights) {
        return request({
            url: `${BASE_URL}/addSight`,
            method: 'post',
            data: sights
        })
    },
    getArea(){
        return request({
            url: `${BASE_URL}/findArea`,
            method: 'post',
        //    data: id,
        })
    },
    getCity(areaId){
        return request({
            url: `${BASE_URL}/findCityByAreaId/${areaId}`,
            method: 'post',
           data:areaId
        })
    },
    getsights(cityId){
        return request({
            url: `${BASE_URL}/findSightsByCityId/${cityId}`,
            method: 'get',
           data:cityId
        })
    },

    // 根据id去得到一个用户 
    getSightsById(id) {
        return request({
            url: `${BASE_URL}/findSightsById/${id}`,
            method: 'get'
        })
    },

    // 修改
    updateSights(sights) {
        return request({
            url: `${BASE_URL}/updateSights`,
            method: 'post',
            data: sights
        })
    },
    //删除
    // 根据id去删除一个用户
    removeId(id) {
        return request({
            url: `${BASE_URL}/removeSights/${id}`,
            method: 'delete'
        })
    },

    
}